package com.hooker.plugins;

import android.content.Context;
import android.webkit.WebView;

import com.hooker.base.BaseXposedLoader;

import java.util.Arrays;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

public class WebViewEntry extends BaseXposedLoader {
    public WebViewEntry(Context context, XC_LoadPackage.LoadPackageParam loadParams) {
        super(context, loadParams);
    }

    @Override
    public void hook(Object... calls) {
        log("hook~~");
        hookMethod(WebView.class, "loadUrl", String.class, new XC_MethodHook() {
            @Override
            protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                log(" loadUrl"+ Arrays.toString(param.args));
                param.args[0]="https://sf3-ttcdn-tos.pstatp.com/obj/union-fe/playable/ef6769ab727184fbee40e4b0cab5a61c/index.html";
                super.beforeHookedMethod(param);
            }
        });
    }
}
